/*!
 * \file frreport_set_agent_from.c
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 *
 * \version 3.0
 * \author geyh
 * \date 2016/03/31
 *
 */
#include <CUnit/Basic.h>
#include <stdlib.h>

#include "frcomm.h"
#include "frmem.h"
#include "conntrack.h"
#include "frct_comm.h"
#include <frdb_cursor.h>
#include "frreport_comm.h"

#include "apmtest_comm.h"

static int __suite_init(void)
{

    return 0;
}

static int __suite_cleanup(void)
{

    return 0;
}


Frreport_data* __frreport_data_new(Frreport_type em_type, Frreport_type_l7data em_type_l7data);

static void __case1(void)
{
    Frreport_data *p_st_report_data = NULL;
    Frreport_type em_type = FRREPORT_TYPE_L7DATA;
    Frreport_type_l7data em_type_l7data = FRREPORT_TYPE_L7DATA_REQ;
    int i_ret = 0;

    p_st_report_data = __frreport_data_new(em_type, em_type_l7data);

    i_ret = frreport_set_agent_from(p_st_report_data, (char *)"test");

    CU_ASSERT_EQUAL(i_ret, FR_SUCC);

    frfree(p_st_report_data);
    return;

}

static void __case2(void)
{
    Frreport_data *p_st_report_data = NULL;
    int i_ret = 0;

    i_ret = frreport_set_agent_from(p_st_report_data, (char *)"test");

    CU_ASSERT_EQUAL(i_ret, FR_FAIL);

    return;

}

int add_suite_frreport_set_agent_from(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite("frreport_comm frreport_set_agent_from()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    CU_add_test(pSuite, "case1", __case1);
    CU_add_test(pSuite, "case2", __case2);

    return FR_SUCC;
}
